//
//  CircleIcon.m
//  sooc-ios_new
//
//  Created by apple on 2016/11/3.
//  Copyright © 2016年 xuguangChao. All rights reserved.
//
#define Color999999 [UIColor colorWithRed:153.0/255 green:153.0/255 blue:153.0/255 alpha:1.0f]
#define colordbdbdb [UIColor colorWithRed:219.0/255 green:219.0/255 blue:219.0/255 alpha:1.0f]
#import "SCUIToolHeader.h"
#import "CircleIcon.h"

#import "dangXiaoHeader_tool.h"

@implementation CircleIcon

- (id)initWithFrame:(CGRect)frame{

    if (self =[super initWithFrame:frame]) {
        
        self.layer.masksToBounds = YES;
        self.layer.cornerRadius = self.frame.size.width/2;
        self.layer.borderWidth = 0.5;
        self.layer.borderColor = Color_Main.CGColor;
        
        self.backgroundColor = Color_Main;
        
        _littleCircle = [[UIView alloc]initWithFrame:CGRectMake(3, 3, self.frame.size.width-6, self.frame.size.width - 6)];
        _littleCircle.layer.masksToBounds = YES;
        _littleCircle.layer.cornerRadius = self.frame.size.width/2 -3;
        _littleCircle.backgroundColor = Color_Main;
        [self addSubview:_littleCircle];
        _littleCircle.hidden = YES;
    }
    return self;
}

- (void)setColorState:(ColorState)colorState{

    switch (colorState) {
        case 0:
            self.layer.borderColor = Color_Main.CGColor;
            
            self.backgroundColor = Color_Main;
            break;
            
        case 1:
            self.layer.borderColor = Color_title_black_26.CGColor;
            
            self.backgroundColor = [UIColor whiteColor];
            break;
            
        case 2:
            self.layer.borderColor = [UIColor orangeColor].CGColor;
            
            self.backgroundColor =  [UIColor whiteColor];
            break;
        case 3:
            self.layer.borderColor = Color_Main.CGColor;
            
            self.backgroundColor =  [UIColor whiteColor];
            
            _littleCircle.hidden = NO;
            
            _littleCircle.backgroundColor = Color_Main;
            
            break;

        case 4:
            self.layer.borderColor = colordbdbdb.CGColor;
            
            self.backgroundColor =  [UIColor whiteColor];
            
            _littleCircle.hidden = NO;
            
            _littleCircle.backgroundColor = [UIColor whiteColor];
            
            break;

        case 5:
            self.layer.borderColor = [UIColor orangeColor].CGColor;
            
            self.backgroundColor =  [UIColor whiteColor];
            
            _littleCircle.hidden = NO;
            
            _littleCircle.backgroundColor =  [UIColor orangeColor];
            
            break;

        default:
            break;
    }
    
}


@end
